package com.qire.manhua.activity;

import android.os.Bundle;

import com.qire.antscore.annotation.RouteMapping;
import com.qire.antsrouter.inject.Autowired;
import com.qire.common.constant.Navigation;
import com.qire.common.inject.EventControllerInjector;
import com.qire.common.inject.ViewModelInjector;
import com.qire.common.support.base.BaseActivity;
import com.qire.common.utils.ThemeUtil;
import com.qire.manhua.R;
import com.qire.manhua.controller.AccountBindGuideController;
import com.qire.manhua.databinding.ActivityAccountBindGuideBinding;
import com.qire.manhua.model.viewModel.impl.AccountBindGuideViewModel;

import androidx.annotation.Nullable;

/**
 * 账户绑定引导页
 */
@RouteMapping(path = Navigation.Page.AccountBindGuidePage)
public class AccountBindGuideActivity extends BaseActivity<ActivityAccountBindGuideBinding> {

    @Autowired(injector = ViewModelInjector.class)
    AccountBindGuideViewModel viewModel;

    @Autowired(injector = EventControllerInjector.class)
    AccountBindGuideController controller;

    @Override
    public int layoutRid() {
        return R.layout.activity_account_bind_guide;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ThemeUtil.changeStatusBarLightOrDark(this, true, true);

        viewModel.onAddition(viewDataBinder());
        controller.onAddition(viewModel);

    }

    @Override
    public void finish() {
        if(viewModel.backPanel()) {
            super.finish();
        }
    }
}
